<h1><%= title "Kingdoms" %></h1>

<table>
  <tr>
    <th>Name</th>
    <th>Culture</th>
	<th>Ruler</th>
  </tr>

<% for kingdom in @kingdoms %>
  <tr>
    <td><%=h kingdom.name %></td>
    <td><%=link_to_record kingdom.culture %></td>
	<td><%=link_to_record Title.king_of kingdom %></td>
    <td><%= link_to 'Show', kingdom %></td>
    <td><%= link_to 'Edit', edit_kingdom_path(kingdom) %></td>
    <td><%= link_to 'Destroy', kingdom, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New kingdom', new_kingdom_path %> | <%= link_to 'Home', '/' %>
